<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 840px;
            padding: 100px 250px;
            box-sizing: border-box;
            
        }
        #firstPrize{
            color: red;
        }
    </style>
</head>
<body>
    <div>
        <p>传智教育年会抽奖</p>
        <h2>一等奖：<span id="firstPrize"></span></h2 >
        <h3>二等奖：<span id="secondPrize"></span></h3 >
        <h4>三等奖：<span id="thirdPrize"></span></h4 >
        <button onclick="choujian()">开始抽奖</button>
    </div>
    <script>
        const names = ['周杰伦', '刘德华', '周星驰', '范老师', '张学友'];
        function choujian() {
            let list = [...names]; 
            let first = list.splice(Math.floor(Math.random() * list.length), 1)[0];
            let second = list.splice(Math.floor(Math.random() * list.length), 1)[0];
            let third = list.splice(Math.floor(Math.random() * list.length), 1)[0];
            document.getElementById('firstPrize').innerText = first;
            document.getElementById('secondPrize').innerText = second;
            document.getElementById('thirdPrize').innerText = third;
        }
    </script>
</body>
</html>